This section describes properties that are common to widgets that display text.
See common widgets attributes.
Name | Value Type | Default Value | Description | Comment | V. |
---|---|---|---|---|---|
multiline |
false |
Enables or disables multiline in the text field. |
If this attribute is not set to 'true', carriage return and line feed characters are not recognized, and word_break property will be inactive. This value is not inherited by children cells. |
1.0 |
|
word_break |
false |
Enables or disables word - breaking at the end of a line. |
This property is used when the width of the widget has been set. If word break and multiline are enabled, the system will display multiple lines when the length of the text to display is larger than the width of the widget. This value is not inherited by children cells. |
1.0 |
|
text_h_align |
center |
Horizontal alignment of the text. |
This value is not inherited by children cells. |
1.0 |
|
text_v_align |
center |
Vertical alignment of the text. |
This attribute is compatible with single line text fields only. This value is not inherited by children cells. |
1.0 |
In order to display special characters (most commonly used are line feed or carriage return), you need to use their HTML codes, as the XML norm specifies it. See http://www.w3.org/MarkUp/html-spec/html-spec_13.html for special character codes reference.
For example, in order to display the following string:
Hello
World
the corresponding 'value' XML attribute for the text field will be the following: Hello World.
stands for 'carriage return character'. See examples below.
Display a simple single line text field with inherited font properties: the first line inherits from the global skin settings, and the second one from the global + cell settings.
<?xml version="1.0" encoding="utf-8" ?> <SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column" h_margin="10" v_margin="10" spacing="4" font_face="Tahoma" font_height="14" text_color="#ffffff" font_quality="cleartype"> <TEXT value="This is a skin." /> <CELL layout_type="row" spacing="10" h_margin="5" v_margin="5" font_height="25"> <TEXT value="Hello World!" /> </CELL> </SKIN>
Display a multi line text field with a carriage return character, aligned to left:
<?xml version="1.0" encoding="utf-8" ?> <SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column" h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff" font_quality="cleartype"> <TEXT multiline="true" font_face="Tahoma" value="This is a skin. Hello World!" text_h_align="left" /> </SKIN>
Display a multi line text field with a fixed width, enabling 'word_break' property. The height of the text field is computed by the system, while the width is fixed by the designer, and words are broken automatically.
<?xml version="1.0" encoding="utf-8" ?> <SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column" h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff" font_quality="cleartype"> <TEXT multiline="true" width="150" font_face="Tahoma" value="This is a skin. Hello World!" text_h_align="left" word_break="true" /> </SKIN>
Display a multi line text field with text aligned to right:
<?xml version="1.0" encoding="utf-8" ?> <SKIN language_version="1.0" background_color="#000000" repeat="true" layout_type="column" h_margin="10" v_margin="10" spacing="4" font_face="Arial" font_height="14" text_color="#ffffff" font_quality="cleartype"> <TEXT multiline="true" font_face="Tahoma" value="This is a skin. Hello World! a b c" text_h_align="right" /> </SKIN>